home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_input_image.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-21  |  5.0 KB  |  102 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="430" height="280" caption="Image button">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="29" height="13" top="8" left="8"/>
  6.             <label name="lblValue" caption="Text/value" hint="Text/value of your form element." width="69" height="13" top="8" left="208"/>
  7.             <speedbutton name="btnFindImageFile" glyph="icons\16x16\look_for_files.bmp" caption="" hint="Led pσ computeren efter et billede." width="19" height="19" top="64" left="364">
  8.                 <event type="onclick">
  9.                     Dlg := TOpenPictureDialog.Create(nil);    
  10.                     ImageExtensions := GetImageTypes();
  11.                     Dlg.Filter := 'Image files ('+ImageExtensions+')|'+ImageExtensions;                                        
  12.                       If Dlg.Execute then
  13.                         begin
  14.                          FileName := Dlg.FileName;
  15.                       edtSrc.Text := GetRelativePath('', FileName);
  16.                      end;
  17.                     Dlg.Free;                    
  18.                 </event>
  19.             </speedbutton>
  20.             <label name="lblSrc" caption="Imagefile" hint="Select the image to be displayed on the button." width="48" height="13" top="48" left="8"/>
  21.             <checkbox name="cbDisabled" caption="Disabled" taborder="3" hint="Your element will be visible, but disabled." checked="0" width="121" height="17" top="88" left="8"/>
  22.             <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="175" height="19" top="24" left="8"/>
  23.             <edit name="edtValue" taborder="1" text="" hint="Text/value of your form element." width="175" height="19" top="24" left="208"/>
  24.             <edit name="edtSrc" taborder="2" text="" hint="Select the image to be displayed on the button." width="350" height="19" top="64" left="8"/>
  25.         </panel>
  26.     </controls>
  27.     <dialogevents>
  28.         <event type="onclose" resulttype="ok">
  29.  
  30.             StartCode := ('<input type="image"');
  31.             if edtName.Text <> '' then
  32.              StartCode := StartCode + (' name="'+(edtName.Text)+'"');
  33.             if edtValue.Text <> '' then
  34.              StartCode := StartCode + ' value="'+edtValue.Text+'"';
  35.             if edtSrc.Text <> '' then
  36.              StartCode := StartCode + ' src="'+edtSrc.Text+'"'; 
  37.             if cbDisabled.Checked then
  38.              StartCode := StartCode + (' disabled');
  39.  
  40.               If edtCSSClass.Text <> '' then
  41.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  42.               If edtCSSId.Text <> '' then
  43.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  44.               If edtCSSStyle.Text <> '' then
  45.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  46.             for i := 0 to EventGrid.Count - 1 do
  47.               begin
  48.               if EventGrid.Rows[i].EditText <> '' then
  49.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  50.              end;
  51.  
  52.             StartCode := StartCode + '>';
  53.             If cbMakeXHTMLCompliant.Checked then
  54.              StartCode := MakeXHTMLCompliant(StartCode, false);
  55.             If cbDoPHPEscape.Checked then
  56.              StartCode := DoPHPEscape(StartCode);
  57.             // A little "hack" - WebCoder will set this, to let us know whether to update
  58.             // an existing tag, or insert a brand new one
  59.             If cbUpdateExistingTag.Checked then
  60.              ReplaceTag(StartCode)
  61.             else
  62.                InsertTags(StartCode, '');
  63.  
  64.         </event>
  65.         <event type="onshow">
  66.             // Lets put the advanced panel in the right place
  67.             pnlAdvanced.Parent := MainPanel;
  68.             pnlAdvanced.Left := 8;
  69.             pnlAdvanced.Top := MainPanel.Height - 32;
  70.             pnlAdvanced.Width := Self.Width - 36;
  71.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  72.             If pnlAdvanced.Height > 20 then
  73.              Self.Height := Self.Height + 200;
  74.         </event>
  75.         <event type="updatedialog">
  76.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  77.             // The entire selected tag will be passed as a parameter to this function, that should update
  78.             // the required fields of the dialog.
  79.             function UpdateDialog(Tag: string);
  80.              begin
  81.  
  82.               edtName.Text := GetValueFromAttribute(Tag, 'name');
  83.               edtValue.Text := GetValueFromAttribute(Tag, 'value');
  84.  
  85.               cbDisabled.Checked := HasOption(Tag, 'disabled');
  86.                   
  87.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  88.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  89.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  90.               for i := 0 to EventGrid.Count - 1 do
  91.                 begin
  92.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  93.                  If EventVal <> '' then
  94.                   EventGrid.Rows[i].EditText := EventVal;
  95.                end;
  96.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  97.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();
  98.              end;
  99.         </event>
  100.     </dialogevents>
  101. </dialog>
  102.